const selfState = {
    num: 1
};

export function Reducer(state = selfState, action) {
    // console.log(action)
    switch (action.type) {
        case "plus":
            state.num++;
            return {
                num:state.num
            };
        case "minus":
            state.num===1?state.num=1:state.num--;
            return {
                num:state.num
            };
        default:
            return state;
    }
}

